<!DOCTYPE html>
<!--
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8"/>
    <title>运营平台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="/static/assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
    <link href="/static/assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/global/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/global/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
    <!-- END PAGE LEVEL PLUGIN STYLES -->
    <!-- BEGIN PAGE STYLES -->
    <link href="/static/assets/admin/pages/css/tasks.css" rel="stylesheet" type="text/css"/>
    <!-- END PAGE STYLES -->
    <!-- BEGIN THEME STYLES -->
    <link href="/static/assets/global/css/components.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/global/css/plugins.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/admin/layout/css/layout.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/admin/layout/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
    <link href="/static/assets/admin/layout/css/custom.css" rel="stylesheet" type="text/css"/>
    <link href="/static/assets/admin/pages/css/search.css" rel="stylesheet" type="text/css"/>
    <!-- END THEME STYLES -->
    <link rel="shortcut icon" href="/public/favicon.ico"/>
    <script src="/static/assets/global/plugins/jquery-1.11.0.min.js" type="text/javascript"></script>
    <style>
        .errMsg{
            display: none;
            color:red;
        }
    </style>
</head>

<!-- END HEAD -->
<!-- BEGIN BODY -->
<!-- DOC: Apply "page-header-fixed-mobile" and "page-footer-fixed-mobile" class to body element to force fixed header or footer in mobile devices -->
<!-- DOC: Apply "page-sidebar-closed" class to the body and "page-sidebar-menu-closed" class to the sidebar menu element to hide the sidebar by default -->
<!-- DOC: Apply "page-sidebar-hide" class to the body to make the sidebar completely hidden on toggle -->
<!-- DOC: Apply "page-sidebar-closed-hide-logo" class to the body element to make the logo hidden on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-hide" class to body element to completely hide the sidebar on sidebar toggle -->
<!-- DOC: Apply "page-sidebar-fixed" class to have fixed sidebar -->
<!-- DOC: Apply "page-footer-fixed" class to the body element to have fixed footer -->
<!-- DOC: Apply "page-sidebar-reversed" class to put the sidebar on the right side -->
<!-- DOC: Apply "page-full-width" class to the body element to have full width page without the sidebar menu -->
<body class="page-header-fixed ">

<header th:replace="admin/common/header :: header"></header>

<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <div th:replace="admin/common/sidebar :: sidebar"></div>
    <!-- BEGIN CONTENT -->
    <div class="page-content-wrapper">
        <div class="page-content">
            <h3 class="page-title">创建门店</h3>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                <form action="/admin/shop/create" id="create" class="form-horizontal form-row-seperated" method="post">
                    <div class="form-body">
                        <div class="form-group">
                            <label class="col-md-3 control-label">门店icon图片路径<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="iconUrl" id="iconUrl" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">门店名<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="name" id="name" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">人均价格<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="pricePerMan" id="pricePerMan" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">地址<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="address" id="address" value="" class="form-control" />
                            </div>
                            <button type="button" id="analyze" class="btn default" style="margin-left:12px;">解析经纬度</button>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">经度<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="longitude" id="longitude" value="" readonly class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">纬度<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="latitude" id="latitude" value="" readonly class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">品类ID<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="categoryId" id="categoryId" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">标签<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="tags" id="tags" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">开始营业时间(格式08:00)<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="startTime" id="startTime" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">结束营业时间(格式22:00)<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="endTime" id="endTime" value="" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">商家ID<span class="required" aria-required="true"></span></label>
                            <div class="col-md-6">
                                <input type="text" name="sellerId" id="sellerId" value="" class="form-control" />
                            </div>
                        </div>
                    </div>
                    <div class="form-actions fluid nobg">
                        <div class="col-md-offset-3 col-md-9">
                            <button type="submit" class="btn yellow-lemon" id="saveButton"><i class="fa fa-check"></i> 创建 </button>
                            <button type="button" class="btn default" style="margin-left:12px;" onclick = "javascript:history.go(-1)"> 取消 </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<footer th:replace="admin/common/footer :: footer"></footer>
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<!--[if lt IE 9]>
<script src="/static/assets/global/plugins/respond.min.js"></script>
<script src="/static/assets/global/plugins/excanvas.min.js"></script>
<![endif]-->
<script src="/static/assets/global/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script src="/static/assets/global/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/jquery.cokie.min.js" type="text/javascript"></script>
<script src="/static/assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<script src="/static/assets/global/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="/static/assets/admin/pages/scripts/sidebarGeneration.js" type="text/javascript"></script>
<script src="/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
<script src="/static/assets/admin/pages/scripts/index.js" type="text/javascript"></script>
<script src="/static/assets/admin/pages/scripts/tasks.js" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>


    jQuery(document).ready(function() {
        Metronic.init(); // init metronic core componets
        Layout.init(); // init layout
        Index.init();
        getFloat = function (number, n) {
            n = n ? parseInt(n) : 0;
            if (n <= 0) return Math.round(number);
            number = Math.round(number * Math.pow(10, n)) / Math.pow(10, n);
            return number;
        };

        $("#analyze").on("click",function(){
            $.ajax({
                type : "POST",
                url : "http://api.map.baidu.com/geocoder/v2/",
                data:"address="+encodeURIComponent($("#address").val())+"&output=json&ak=9wV8VNAp1qm8FLQzVZ70dcIS6HNwTXBk",
                dataType:"jsonp",
                jsonp:"callback",
                jsonpCallback:"showLocation",
                success : function(data){
                    if(data.status == 0){
                        alert("地址解析成功");
                        $("#latitude").val(getFloat(data.result.location.lat,6));
                        $("#longitude").val(getFloat(data.result.location.lng,6));
                    }else{
                        alert("获取百度地图失败，原因为"+data);
                    }
                },
                error : function(data){
                    alert("获取百度地图失败，原因为"+data.responseText);
                }
            });
            return false;
        });

    });
</script>
</body>
</html>